package com.tian.mall;

import java.util.Arrays;

/**
 * @author zhumengping
 * @title: EmailEnums
 * @projectName zhump-cloud
 * @date 2023/8/2 10:02
 */
public enum EmailEnums {

    /**163邮箱**/
    EMAIL_163(MailTypeEnums.MAIL_163,"smtp.163.com","465","163邮箱"),
    /**qq邮箱**/
    EMAIL_QQ(MailTypeEnums.MAIL_QQ,"smtp.qq.com","465","qq邮箱")


    ;

    private MailTypeEnums mailType;

    private String mailHost;

    private String mailPort;

    private String mailDesc;

    EmailEnums(MailTypeEnums mailType, String mailHost, String mailPort, String mailDesc) {
        this.mailType = mailType;
        this.mailHost = mailHost;
        this.mailPort = mailPort;
        this.mailDesc = mailDesc;
    }

    public MailTypeEnums getMailType() {
        return mailType;
    }

    public void setMailType(MailTypeEnums mailType) {
        this.mailType = mailType;
    }

    public String getMailHost() {
        return mailHost;
    }

    public void setMailHost(String mailHost) {
        this.mailHost = mailHost;
    }

    public String getMailPort() {
        return mailPort;
    }

    public void setMailPort(String mailPort) {
        this.mailPort = mailPort;
    }

    public String getMailDesc() {
        return mailDesc;
    }

    public void setMailDesc(String mailDesc) {
        this.mailDesc = mailDesc;
    }


    public static EmailEnums getInstance(MailTypeEnums enums){
        return Arrays.stream(EmailEnums.values()).filter(o->o.getMailType().equals(enums)).findFirst().orElse(null);
    }
}
